<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'main.jsp' starting page</title>
  </head>
  <body>
  <a href="prod.jspx?m=add">添加商品 </a> <a href="order.jspx?m=show">我的订单</a>  <a href="shopcar.jspx">我的购物车</a>
  <table border="1px" width="70%">
  <tr><th>商品名称</th><th>商品价格</th><th>操作</th></tr>
	<c:forEach items="${requestScope.prodList }" var="prod">
		<tr>
		<td>${prod.prodname }</td>
		<td>${prod.price }</td>
		<td>
		<a href="prod.jspx?m=edit&id=${prod.id }">修改</a>
		<a href="prod.jspx?m=del&id=${prod.id }">删除</a>
		<a href="shopcar.jspx?m=addcar&id=${prod.id }">加入购物车</a>
		</td>
		</tr>
	</c:forEach>	
	</table>
	<c:choose>
		<c:when test="${requestScope.code=='10001' }">
			<div style="color:red">你要删除的商品不存在!</div>
		</c:when>
		<c:when test="${requestScope.code=='10006' }">
			<div style="color:red">你要删除的商品不存在!</div>
		</c:when>
		<c:when test="${requestScope.code=='10007' }">
			<div style="color:red">你要删除的商品不存在!</div>
		</c:when>
	</c:choose>
  </body>
</html>
